cmake_minimum_required(VERSION 3.6)

get_filename_component(PATH_TO_ROOT "../../../../.." ABSOLUTE)

project("libcrypto.Android")

include("../../GetLibHCBinaryOutputDir.cmake")
get_libhc_binary_output_dir("${PATH_TO_ROOT}" LIBHC_BINARY_DIR)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${LIBHC_BINARY_DIR}")

set(CMAKE_STATIC_LIBRARY_PREFIX "")

###########################################
### Set up paths for source and include ###
###########################################

set(PATH_TO_EXTERNAL "${PATH_TO_ROOT}/External")
set(PATH_TO_OPENSSL "${PATH_TO_EXTERNAL}/openssl")
set(PATH_TO_CRYPTO "${PATH_TO_OPENSSL}/crypto")

set(CRYPTO_SOURCE_FILES
    "${PATH_TO_CRYPTO}/aes/aes_cbc.c"
    "${PATH_TO_CRYPTO}/aes/aes_cfb.c"
    "${PATH_TO_CRYPTO}/aes/aes_core.c"
    "${PATH_TO_CRYPTO}/aes/aes_ecb.c"
    "${PATH_TO_CRYPTO}/aes/aes_ige.c"
    "${PATH_TO_CRYPTO}/aes/aes_misc.c"
    "${PATH_TO_CRYPTO}/aes/aes_ofb.c"
    "${PATH_TO_CRYPTO}/aes/aes_wrap.c"
    "${PATH_TO_CRYPTO}/aria/aria.c"
    "${PATH_TO_CRYPTO}/asn1/a_bitstr.c"
    "${PATH_TO_CRYPTO}/asn1/a_d2i_fp.c"
    "${PATH_TO_CRYPTO}/asn1/a_digest.c"
    "${PATH_TO_CRYPTO}/asn1/a_dup.c"
    "${PATH_TO_CRYPTO}/asn1/a_gentm.c"
    "${PATH_TO_CRYPTO}/asn1/a_i2d_fp.c"
    "${PATH_TO_CRYPTO}/asn1/a_int.c"
    "${PATH_TO_CRYPTO}/asn1/a_mbstr.c"
    "${PATH_TO_CRYPTO}/asn1/a_object.c"
    "${PATH_TO_CRYPTO}/asn1/a_octet.c"
    "${PATH_TO_CRYPTO}/asn1/a_print.c"
    "${PATH_TO_CRYPTO}/asn1/a_sign.c"
    "${PATH_TO_CRYPTO}/asn1/a_strex.c"
    "${PATH_TO_CRYPTO}/asn1/a_strnid.c"
    "${PATH_TO_CRYPTO}/asn1/a_time.c"
    "${PATH_TO_CRYPTO}/asn1/a_type.c"
    "${PATH_TO_CRYPTO}/asn1/a_utctm.c"
    "${PATH_TO_CRYPTO}/asn1/a_utf8.c"
    "${PATH_TO_CRYPTO}/asn1/a_verify.c"
    "${PATH_TO_CRYPTO}/asn1/ameth_lib.c"
    "${PATH_TO_CRYPTO}/asn1/asn1_err.c"
    "${PATH_TO_CRYPTO}/asn1/asn1_gen.c"
    "${PATH_TO_CRYPTO}/asn1/asn1_item_list.c"
    "${PATH_TO_CRYPTO}/asn1/asn1_lib.c"
    "${PATH_TO_CRYPTO}/asn1/asn1_par.c"
    "${PATH_TO_CRYPTO}/asn1/asn_mime.c"
    "${PATH_TO_CRYPTO}/asn1/asn_moid.c"
    "${PATH_TO_CRYPTO}/asn1/asn_mstbl.c"
    "${PATH_TO_CRYPTO}/asn1/asn_pack.c"
    "${PATH_TO_CRYPTO}/asn1/bio_asn1.c"
    "${PATH_TO_CRYPTO}/asn1/bio_ndef.c"
    "${PATH_TO_CRYPTO}/asn1/d2i_pr.c"
    "${PATH_TO_CRYPTO}/asn1/d2i_pu.c"
    "${PATH_TO_CRYPTO}/asn1/evp_asn1.c"
    "${PATH_TO_CRYPTO}/asn1/f_int.c"
    "${PATH_TO_CRYPTO}/asn1/f_string.c"
    "${PATH_TO_CRYPTO}/asn1/i2d_pr.c"
    "${PATH_TO_CRYPTO}/asn1/i2d_pu.c"
    "${PATH_TO_CRYPTO}/asn1/n_pkey.c"
    "${PATH_TO_CRYPTO}/asn1/nsseq.c"
    "${PATH_TO_CRYPTO}/asn1/p5_pbe.c"
    "${PATH_TO_CRYPTO}/asn1/p5_pbev2.c"
    "${PATH_TO_CRYPTO}/asn1/p5_scrypt.c"
    "${PATH_TO_CRYPTO}/asn1/p8_pkey.c"
    "${PATH_TO_CRYPTO}/asn1/t_bitst.c"
    "${PATH_TO_CRYPTO}/asn1/t_pkey.c"
    "${PATH_TO_CRYPTO}/asn1/t_spki.c"
    "${PATH_TO_CRYPTO}/asn1/tasn_dec.c"
    "${PATH_TO_CRYPTO}/asn1/tasn_enc.c"
    "${PATH_TO_CRYPTO}/asn1/tasn_fre.c"
    "${PATH_TO_CRYPTO}/asn1/tasn_new.c"
    "${PATH_TO_CRYPTO}/asn1/tasn_prn.c"
    "${PATH_TO_CRYPTO}/asn1/tasn_scn.c"
    "${PATH_TO_CRYPTO}/asn1/tasn_typ.c"
    "${PATH_TO_CRYPTO}/asn1/tasn_utl.c"
    "${PATH_TO_CRYPTO}/asn1/x_algor.c"
    "${PATH_TO_CRYPTO}/asn1/x_bignum.c"
    "${PATH_TO_CRYPTO}/asn1/x_info.c"
    "${PATH_TO_CRYPTO}/asn1/x_int64.c"
    "${PATH_TO_CRYPTO}/asn1/x_long.c"
    "${PATH_TO_CRYPTO}/asn1/x_pkey.c"
    "${PATH_TO_CRYPTO}/asn1/x_sig.c"
    "${PATH_TO_CRYPTO}/asn1/x_spki.c"
    "${PATH_TO_CRYPTO}/asn1/x_val.c"
    "${PATH_TO_CRYPTO}/async/arch/async_null.c"
    "${PATH_TO_CRYPTO}/async/arch/async_posix.c"
    "${PATH_TO_CRYPTO}/async/arch/async_win.c"
    "${PATH_TO_CRYPTO}/async/async.c"
    "${PATH_TO_CRYPTO}/async/async_err.c"
    "${PATH_TO_CRYPTO}/async/async_wait.c"
    "${PATH_TO_CRYPTO}/bf/bf_cfb64.c"
    "${PATH_TO_CRYPTO}/bf/bf_ecb.c"
    "${PATH_TO_CRYPTO}/bf/bf_enc.c"
    "${PATH_TO_CRYPTO}/bf/bf_ofb64.c"
    "${PATH_TO_CRYPTO}/bf/bf_skey.c"
    "${PATH_TO_CRYPTO}/bio/b_addr.c"
    "${PATH_TO_CRYPTO}/bio/b_dump.c"
    "${PATH_TO_CRYPTO}/bio/b_print.c"
    "${PATH_TO_CRYPTO}/bio/b_sock.c"
    "${PATH_TO_CRYPTO}/bio/b_sock2.c"
    "${PATH_TO_CRYPTO}/bio/bf_buff.c"
    "${PATH_TO_CRYPTO}/bio/bf_lbuf.c"
    "${PATH_TO_CRYPTO}/bio/bf_nbio.c"
    "${PATH_TO_CRYPTO}/bio/bf_null.c"
    "${PATH_TO_CRYPTO}/bio/bio_cb.c"
    "${PATH_TO_CRYPTO}/bio/bio_err.c"
    "${PATH_TO_CRYPTO}/bio/bio_lib.c"
    "${PATH_TO_CRYPTO}/bio/bio_meth.c"
    "${PATH_TO_CRYPTO}/bio/bss_acpt.c"
    "${PATH_TO_CRYPTO}/bio/bss_bio.c"
    "${PATH_TO_CRYPTO}/bio/bss_conn.c"
    "${PATH_TO_CRYPTO}/bio/bss_dgram.c"
    "${PATH_TO_CRYPTO}/bio/bss_fd.c"
    "${PATH_TO_CRYPTO}/bio/bss_file.c"
    "${PATH_TO_CRYPTO}/bio/bss_log.c"
    "${PATH_TO_CRYPTO}/bio/bss_mem.c"
    "${PATH_TO_CRYPTO}/bio/bss_null.c"
    "${PATH_TO_CRYPTO}/bio/bss_sock.c"
    "${PATH_TO_CRYPTO}/blake2/blake2b.c"
    "${PATH_TO_CRYPTO}/blake2/blake2s.c"
    "${PATH_TO_CRYPTO}/blake2/m_blake2b.c"
    "${PATH_TO_CRYPTO}/blake2/m_blake2s.c"
    "${PATH_TO_CRYPTO}/bn/bn_add.c"
    "${PATH_TO_CRYPTO}/bn/bn_asm.c"
    "${PATH_TO_CRYPTO}/bn/bn_blind.c"
    "${PATH_TO_CRYPTO}/bn/bn_const.c"
    "${PATH_TO_CRYPTO}/bn/bn_ctx.c"
    "${PATH_TO_CRYPTO}/bn/bn_depr.c"
    "${PATH_TO_CRYPTO}/bn/bn_dh.c"
    "${PATH_TO_CRYPTO}/bn/bn_div.c"
    "${PATH_TO_CRYPTO}/bn/bn_err.c"
    "${PATH_TO_CRYPTO}/bn/bn_exp.c"
    "${PATH_TO_CRYPTO}/bn/bn_exp2.c"
    "${PATH_TO_CRYPTO}/bn/bn_gcd.c"
    "${PATH_TO_CRYPTO}/bn/bn_gf2m.c"
    "${PATH_TO_CRYPTO}/bn/bn_intern.c"
    "${PATH_TO_CRYPTO}/bn/bn_kron.c"
    "${PATH_TO_CRYPTO}/bn/bn_lib.c"
    "${PATH_TO_CRYPTO}/bn/bn_mod.c"
    "${PATH_TO_CRYPTO}/bn/bn_mont.c"
    "${PATH_TO_CRYPTO}/bn/bn_mpi.c"
    "${PATH_TO_CRYPTO}/bn/bn_mul.c"
    "${PATH_TO_CRYPTO}/bn/bn_nist.c"
    "${PATH_TO_CRYPTO}/bn/bn_prime.c"
    "${PATH_TO_CRYPTO}/bn/bn_print.c"
    "${PATH_TO_CRYPTO}/bn/bn_rand.c"
    "${PATH_TO_CRYPTO}/bn/bn_recp.c"
    "${PATH_TO_CRYPTO}/bn/bn_shift.c"
    "${PATH_TO_CRYPTO}/bn/bn_sqr.c"
    "${PATH_TO_CRYPTO}/bn/bn_sqrt.c"
    "${PATH_TO_CRYPTO}/bn/bn_srp.c"
    "${PATH_TO_CRYPTO}/bn/bn_word.c"
    "${PATH_TO_CRYPTO}/bn/bn_x931p.c"
    "${PATH_TO_CRYPTO}/buffer/buf_err.c"
    "${PATH_TO_CRYPTO}/buffer/buffer.c"
    "${PATH_TO_CRYPTO}/camellia/camellia.c"
    "${PATH_TO_CRYPTO}/camellia/cmll_cbc.c"
    "${PATH_TO_CRYPTO}/camellia/cmll_cfb.c"
    "${PATH_TO_CRYPTO}/camellia/cmll_ctr.c"
    "${PATH_TO_CRYPTO}/camellia/cmll_ecb.c"
    "${PATH_TO_CRYPTO}/camellia/cmll_misc.c"
    "${PATH_TO_CRYPTO}/camellia/cmll_ofb.c"
    "${PATH_TO_CRYPTO}/cast/c_cfb64.c"
    "${PATH_TO_CRYPTO}/cast/c_ecb.c"
    "${PATH_TO_CRYPTO}/cast/c_enc.c"
    "${PATH_TO_CRYPTO}/cast/c_ofb64.c"
    "${PATH_TO_CRYPTO}/cast/c_skey.c"
    "${PATH_TO_CRYPTO}/chacha/chacha_enc.c"
    "${PATH_TO_CRYPTO}/cmac/cm_ameth.c"
    "${PATH_TO_CRYPTO}/cmac/cm_pmeth.c"
    "${PATH_TO_CRYPTO}/cmac/cmac.c"
    "${PATH_TO_CRYPTO}/cms/cms_asn1.c"
    "${PATH_TO_CRYPTO}/cms/cms_att.c"
    "${PATH_TO_CRYPTO}/cms/cms_cd.c"
    "${PATH_TO_CRYPTO}/cms/cms_dd.c"
    "${PATH_TO_CRYPTO}/cms/cms_enc.c"
    "${PATH_TO_CRYPTO}/cms/cms_env.c"
    "${PATH_TO_CRYPTO}/cms/cms_err.c"
    "${PATH_TO_CRYPTO}/cms/cms_ess.c"
    "${PATH_TO_CRYPTO}/cms/cms_io.c"
    "${PATH_TO_CRYPTO}/cms/cms_kari.c"
    "${PATH_TO_CRYPTO}/cms/cms_lib.c"
    "${PATH_TO_CRYPTO}/cms/cms_pwri.c"
    "${PATH_TO_CRYPTO}/cms/cms_sd.c"
    "${PATH_TO_CRYPTO}/cms/cms_smime.c"
    "${PATH_TO_CRYPTO}/comp/c_zlib.c"
    "${PATH_TO_CRYPTO}/comp/comp_err.c"
    "${PATH_TO_CRYPTO}/comp/comp_lib.c"
    "${PATH_TO_CRYPTO}/conf/conf_api.c"
    "${PATH_TO_CRYPTO}/conf/conf_def.c"
    "${PATH_TO_CRYPTO}/conf/conf_err.c"
    "${PATH_TO_CRYPTO}/conf/conf_lib.c"
    "${PATH_TO_CRYPTO}/conf/conf_mall.c"
    "${PATH_TO_CRYPTO}/conf/conf_mod.c"
    "${PATH_TO_CRYPTO}/conf/conf_sap.c"
    "${PATH_TO_CRYPTO}/conf/conf_ssl.c"
    "${PATH_TO_CRYPTO}/cpt_err.c"
    "${PATH_TO_CRYPTO}/cryptlib.c"
    "${PATH_TO_CRYPTO}/ct/ct_b64.c"
    "${PATH_TO_CRYPTO}/ct/ct_err.c"
    "${PATH_TO_CRYPTO}/ct/ct_log.c"
    "${PATH_TO_CRYPTO}/ct/ct_oct.c"
    "${PATH_TO_CRYPTO}/ct/ct_policy.c"
    "${PATH_TO_CRYPTO}/ct/ct_prn.c"
    "${PATH_TO_CRYPTO}/ct/ct_sct.c"
    "${PATH_TO_CRYPTO}/ct/ct_sct_ctx.c"
    "${PATH_TO_CRYPTO}/ct/ct_vfy.c"
    "${PATH_TO_CRYPTO}/ct/ct_x509v3.c"
    "${PATH_TO_CRYPTO}/ctype.c"
    "${PATH_TO_CRYPTO}/cversion.c"
    "${PATH_TO_CRYPTO}/des/cbc_cksm.c"
    "${PATH_TO_CRYPTO}/des/cbc_enc.c"
    "${PATH_TO_CRYPTO}/des/cfb64ede.c"
    "${PATH_TO_CRYPTO}/des/cfb64enc.c"
    "${PATH_TO_CRYPTO}/des/cfb_enc.c"
    "${PATH_TO_CRYPTO}/des/des_enc.c"
    "${PATH_TO_CRYPTO}/des/ecb3_enc.c"
    "${PATH_TO_CRYPTO}/des/ecb_enc.c"
    "${PATH_TO_CRYPTO}/des/fcrypt.c"
    "${PATH_TO_CRYPTO}/des/fcrypt_b.c"
    "${PATH_TO_CRYPTO}/des/ofb64ede.c"
    "${PATH_TO_CRYPTO}/des/ofb64enc.c"
    "${PATH_TO_CRYPTO}/des/ofb_enc.c"
    "${PATH_TO_CRYPTO}/des/pcbc_enc.c"
    "${PATH_TO_CRYPTO}/des/qud_cksm.c"
    "${PATH_TO_CRYPTO}/des/rand_key.c"
    "${PATH_TO_CRYPTO}/des/set_key.c"
    "${PATH_TO_CRYPTO}/des/str2key.c"
    "${PATH_TO_CRYPTO}/des/xcbc_enc.c"
    "${PATH_TO_CRYPTO}/dh/dh_ameth.c"
    "${PATH_TO_CRYPTO}/dh/dh_asn1.c"
    "${PATH_TO_CRYPTO}/dh/dh_check.c"
    "${PATH_TO_CRYPTO}/dh/dh_depr.c"
    "${PATH_TO_CRYPTO}/dh/dh_err.c"
    "${PATH_TO_CRYPTO}/dh/dh_gen.c"
    "${PATH_TO_CRYPTO}/dh/dh_kdf.c"
    "${PATH_TO_CRYPTO}/dh/dh_key.c"
    "${PATH_TO_CRYPTO}/dh/dh_lib.c"
    "${PATH_TO_CRYPTO}/dh/dh_meth.c"
    "${PATH_TO_CRYPTO}/dh/dh_pmeth.c"
    "${PATH_TO_CRYPTO}/dh/dh_prn.c"
    "${PATH_TO_CRYPTO}/dh/dh_rfc5114.c"
    "${PATH_TO_CRYPTO}/dh/dh_rfc7919.c"
    "${PATH_TO_CRYPTO}/dsa/dsa_ameth.c"
    "${PATH_TO_CRYPTO}/dsa/dsa_asn1.c"
    "${PATH_TO_CRYPTO}/dsa/dsa_depr.c"
    "${PATH_TO_CRYPTO}/dsa/dsa_err.c"
    "${PATH_TO_CRYPTO}/dsa/dsa_gen.c"
    "${PATH_TO_CRYPTO}/dsa/dsa_key.c"
    "${PATH_TO_CRYPTO}/dsa/dsa_lib.c"
    "${PATH_TO_CRYPTO}/dsa/dsa_meth.c"
    "${PATH_TO_CRYPTO}/dsa/dsa_ossl.c"
    "${PATH_TO_CRYPTO}/dsa/dsa_pmeth.c"
    "${PATH_TO_CRYPTO}/dsa/dsa_prn.c"
    "${PATH_TO_CRYPTO}/dsa/dsa_sign.c"
    "${PATH_TO_CRYPTO}/dsa/dsa_vrf.c"
    "${PATH_TO_CRYPTO}/dso/dso_dl.c"
    "${PATH_TO_CRYPTO}/dso/dso_dlfcn.c"
    "${PATH_TO_CRYPTO}/dso/dso_err.c"
    "${PATH_TO_CRYPTO}/dso/dso_lib.c"
    "${PATH_TO_CRYPTO}/dso/dso_openssl.c"
    "${PATH_TO_CRYPTO}/dso/dso_vms.c"
    "${PATH_TO_CRYPTO}/dso/dso_win32.c"
    "${PATH_TO_CRYPTO}/ebcdic.c"
    "${PATH_TO_CRYPTO}/ec/curve25519.c"
    "${PATH_TO_CRYPTO}/ec/curve448/arch_32/f_impl.c"
    "${PATH_TO_CRYPTO}/ec/curve448/curve448.c"
    "${PATH_TO_CRYPTO}/ec/curve448/curve448_tables.c"
    "${PATH_TO_CRYPTO}/ec/curve448/eddsa.c"
    "${PATH_TO_CRYPTO}/ec/curve448/f_generic.c"
    "${PATH_TO_CRYPTO}/ec/curve448/scalar.c"
    "${PATH_TO_CRYPTO}/ec/ec2_oct.c"
    "${PATH_TO_CRYPTO}/ec/ec2_smpl.c"
    "${PATH_TO_CRYPTO}/ec/ec_ameth.c"
    "${PATH_TO_CRYPTO}/ec/ec_asn1.c"
    "${PATH_TO_CRYPTO}/ec/ec_check.c"
    "${PATH_TO_CRYPTO}/ec/ec_curve.c"
    "${PATH_TO_CRYPTO}/ec/ec_cvt.c"
    "${PATH_TO_CRYPTO}/ec/ec_err.c"
    "${PATH_TO_CRYPTO}/ec/ec_key.c"
    "${PATH_TO_CRYPTO}/ec/ec_kmeth.c"
    "${PATH_TO_CRYPTO}/ec/ec_lib.c"
    "${PATH_TO_CRYPTO}/ec/ec_mult.c"
    "${PATH_TO_CRYPTO}/ec/ec_oct.c"
    "${PATH_TO_CRYPTO}/ec/ec_pmeth.c"
    "${PATH_TO_CRYPTO}/ec/ec_print.c"
    "${PATH_TO_CRYPTO}/ec/ecdh_kdf.c"
    "${PATH_TO_CRYPTO}/ec/ecdh_ossl.c"
    "${PATH_TO_CRYPTO}/ec/ecdsa_ossl.c"
    "${PATH_TO_CRYPTO}/ec/ecdsa_sign.c"
    "${PATH_TO_CRYPTO}/ec/ecdsa_vrf.c"
    "${PATH_TO_CRYPTO}/ec/eck_prn.c"
    "${PATH_TO_CRYPTO}/ec/ecp_mont.c"
    "${PATH_TO_CRYPTO}/ec/ecp_nist.c"
    "${PATH_TO_CRYPTO}/ec/ecp_nistp224.c"
    "${PATH_TO_CRYPTO}/ec/ecp_nistp256.c"
    "${PATH_TO_CRYPTO}/ec/ecp_nistp521.c"
    "${PATH_TO_CRYPTO}/ec/ecp_nistputil.c"
    "${PATH_TO_CRYPTO}/ec/ecp_oct.c"
    "${PATH_TO_CRYPTO}/ec/ecp_smpl.c"
    "${PATH_TO_CRYPTO}/ec/ecx_meth.c"
    "${PATH_TO_CRYPTO}/engine/eng_all.c"
    "${PATH_TO_CRYPTO}/engine/eng_cnf.c"
    "${PATH_TO_CRYPTO}/engine/eng_ctrl.c"
    "${PATH_TO_CRYPTO}/engine/eng_dyn.c"
    "${PATH_TO_CRYPTO}/engine/eng_err.c"
    "${PATH_TO_CRYPTO}/engine/eng_fat.c"
    "${PATH_TO_CRYPTO}/engine/eng_init.c"
    "${PATH_TO_CRYPTO}/engine/eng_lib.c"
    "${PATH_TO_CRYPTO}/engine/eng_list.c"
    "${PATH_TO_CRYPTO}/engine/eng_openssl.c"
    "${PATH_TO_CRYPTO}/engine/eng_pkey.c"
    "${PATH_TO_CRYPTO}/engine/eng_rdrand.c"
    "${PATH_TO_CRYPTO}/engine/eng_table.c"
    "${PATH_TO_CRYPTO}/engine/tb_asnmth.c"
    "${PATH_TO_CRYPTO}/engine/tb_cipher.c"
    "${PATH_TO_CRYPTO}/engine/tb_dh.c"
    "${PATH_TO_CRYPTO}/engine/tb_digest.c"
    "${PATH_TO_CRYPTO}/engine/tb_dsa.c"
    "${PATH_TO_CRYPTO}/engine/tb_eckey.c"
    "${PATH_TO_CRYPTO}/engine/tb_pkmeth.c"
    "${PATH_TO_CRYPTO}/engine/tb_rand.c"
    "${PATH_TO_CRYPTO}/engine/tb_rsa.c"
    "${PATH_TO_CRYPTO}/err/err.c"
    "${PATH_TO_CRYPTO}/err/err_all.c"
    "${PATH_TO_CRYPTO}/err/err_prn.c"
    "${PATH_TO_CRYPTO}/evp/bio_b64.c"
    "${PATH_TO_CRYPTO}/evp/bio_enc.c"
    "${PATH_TO_CRYPTO}/evp/bio_md.c"
    "${PATH_TO_CRYPTO}/evp/bio_ok.c"
    "${PATH_TO_CRYPTO}/evp/c_allc.c"
    "${PATH_TO_CRYPTO}/evp/c_alld.c"
    "${PATH_TO_CRYPTO}/evp/cmeth_lib.c"
    "${PATH_TO_CRYPTO}/evp/digest.c"
    "${PATH_TO_CRYPTO}/evp/e_aes.c"
    "${PATH_TO_CRYPTO}/evp/e_aes_cbc_hmac_sha1.c"
    "${PATH_TO_CRYPTO}/evp/e_aes_cbc_hmac_sha256.c"
    "${PATH_TO_CRYPTO}/evp/e_aria.c"
    "${PATH_TO_CRYPTO}/evp/e_bf.c"
    "${PATH_TO_CRYPTO}/evp/e_camellia.c"
    "${PATH_TO_CRYPTO}/evp/e_cast.c"
    "${PATH_TO_CRYPTO}/evp/e_chacha20_poly1305.c"
    "${PATH_TO_CRYPTO}/evp/e_des.c"
    "${PATH_TO_CRYPTO}/evp/e_des3.c"
    "${PATH_TO_CRYPTO}/evp/e_idea.c"
    "${PATH_TO_CRYPTO}/evp/e_null.c"
    "${PATH_TO_CRYPTO}/evp/e_old.c"
    "${PATH_TO_CRYPTO}/evp/e_rc2.c"
    "${PATH_TO_CRYPTO}/evp/e_rc4.c"
    "${PATH_TO_CRYPTO}/evp/e_rc4_hmac_md5.c"
    "${PATH_TO_CRYPTO}/evp/e_rc5.c"
    "${PATH_TO_CRYPTO}/evp/e_seed.c"
    "${PATH_TO_CRYPTO}/evp/e_sm4.c"
    "${PATH_TO_CRYPTO}/evp/e_xcbc_d.c"
    "${PATH_TO_CRYPTO}/evp/encode.c"
    "${PATH_TO_CRYPTO}/evp/evp_cnf.c"
    "${PATH_TO_CRYPTO}/evp/evp_enc.c"
    "${PATH_TO_CRYPTO}/evp/evp_err.c"
    "${PATH_TO_CRYPTO}/evp/evp_key.c"
    "${PATH_TO_CRYPTO}/evp/evp_lib.c"
    "${PATH_TO_CRYPTO}/evp/evp_pbe.c"
    "${PATH_TO_CRYPTO}/evp/evp_pkey.c"
    "${PATH_TO_CRYPTO}/evp/m_md2.c"
    "${PATH_TO_CRYPTO}/evp/m_md4.c"
    "${PATH_TO_CRYPTO}/evp/m_md5.c"
    "${PATH_TO_CRYPTO}/evp/m_md5_sha1.c"
    "${PATH_TO_CRYPTO}/evp/m_mdc2.c"
    "${PATH_TO_CRYPTO}/evp/m_null.c"
    "${PATH_TO_CRYPTO}/evp/m_ripemd.c"
    "${PATH_TO_CRYPTO}/evp/m_sha1.c"
    "${PATH_TO_CRYPTO}/evp/m_sha3.c"
    "${PATH_TO_CRYPTO}/evp/m_sigver.c"
    "${PATH_TO_CRYPTO}/evp/m_wp.c"
    "${PATH_TO_CRYPTO}/evp/names.c"
    "${PATH_TO_CRYPTO}/evp/p5_crpt.c"
    "${PATH_TO_CRYPTO}/evp/p5_crpt2.c"
    "${PATH_TO_CRYPTO}/evp/p_dec.c"
    "${PATH_TO_CRYPTO}/evp/p_enc.c"
    "${PATH_TO_CRYPTO}/evp/p_lib.c"
    "${PATH_TO_CRYPTO}/evp/p_open.c"
    "${PATH_TO_CRYPTO}/evp/p_seal.c"
    "${PATH_TO_CRYPTO}/evp/p_sign.c"
    "${PATH_TO_CRYPTO}/evp/p_verify.c"
    "${PATH_TO_CRYPTO}/evp/pbe_scrypt.c"
    "${PATH_TO_CRYPTO}/evp/pmeth_fn.c"
    "${PATH_TO_CRYPTO}/evp/pmeth_gn.c"
    "${PATH_TO_CRYPTO}/evp/pmeth_lib.c"
    "${PATH_TO_CRYPTO}/ex_data.c"
    "${PATH_TO_CRYPTO}/getenv.c"
    "${PATH_TO_CRYPTO}/hmac/hm_ameth.c"
    "${PATH_TO_CRYPTO}/hmac/hm_pmeth.c"
    "${PATH_TO_CRYPTO}/hmac/hmac.c"
    "${PATH_TO_CRYPTO}/idea/i_cbc.c"
    "${PATH_TO_CRYPTO}/idea/i_cfb64.c"
    "${PATH_TO_CRYPTO}/idea/i_ecb.c"
    "${PATH_TO_CRYPTO}/idea/i_ofb64.c"
    "${PATH_TO_CRYPTO}/idea/i_skey.c"
    "${PATH_TO_CRYPTO}/init.c"
    "${PATH_TO_CRYPTO}/kdf/hkdf.c"
    "${PATH_TO_CRYPTO}/kdf/kdf_err.c"
    "${PATH_TO_CRYPTO}/kdf/scrypt.c"
    "${PATH_TO_CRYPTO}/kdf/tls1_prf.c"
    "${PATH_TO_CRYPTO}/lhash/lh_stats.c"
    "${PATH_TO_CRYPTO}/lhash/lhash.c"
    "${PATH_TO_CRYPTO}/md4/md4_dgst.c"
    "${PATH_TO_CRYPTO}/md4/md4_one.c"
    "${PATH_TO_CRYPTO}/md5/md5_dgst.c"
    "${PATH_TO_CRYPTO}/md5/md5_one.c"
    "${PATH_TO_CRYPTO}/mdc2/mdc2_one.c"
    "${PATH_TO_CRYPTO}/mdc2/mdc2dgst.c"
    "${PATH_TO_CRYPTO}/mem.c"
    "${PATH_TO_CRYPTO}/mem_clr.c"
    "${PATH_TO_CRYPTO}/mem_dbg.c"
    "${PATH_TO_CRYPTO}/mem_sec.c"
    "${PATH_TO_CRYPTO}/modes/cbc128.c"
    "${PATH_TO_CRYPTO}/modes/ccm128.c"
    "${PATH_TO_CRYPTO}/modes/cfb128.c"
    "${PATH_TO_CRYPTO}/modes/ctr128.c"
    "${PATH_TO_CRYPTO}/modes/cts128.c"
    "${PATH_TO_CRYPTO}/modes/gcm128.c"
    "${PATH_TO_CRYPTO}/modes/ocb128.c"
    "${PATH_TO_CRYPTO}/modes/ofb128.c"
    "${PATH_TO_CRYPTO}/modes/wrap128.c"
    "${PATH_TO_CRYPTO}/modes/xts128.c"
    "${PATH_TO_CRYPTO}/o_dir.c"
    "${PATH_TO_CRYPTO}/o_fips.c"
    "${PATH_TO_CRYPTO}/o_fopen.c"
    "${PATH_TO_CRYPTO}/o_init.c"
    "${PATH_TO_CRYPTO}/o_str.c"
    "${PATH_TO_CRYPTO}/o_time.c"
    "${PATH_TO_CRYPTO}/objects/o_names.c"
    "${PATH_TO_CRYPTO}/objects/obj_dat.c"
    "${PATH_TO_CRYPTO}/objects/obj_err.c"
    "${PATH_TO_CRYPTO}/objects/obj_lib.c"
    "${PATH_TO_CRYPTO}/objects/obj_xref.c"
    "${PATH_TO_CRYPTO}/ocsp/ocsp_asn.c"
    "${PATH_TO_CRYPTO}/ocsp/ocsp_cl.c"
    "${PATH_TO_CRYPTO}/ocsp/ocsp_err.c"
    "${PATH_TO_CRYPTO}/ocsp/ocsp_ext.c"
    "${PATH_TO_CRYPTO}/ocsp/ocsp_ht.c"
    "${PATH_TO_CRYPTO}/ocsp/ocsp_lib.c"
    "${PATH_TO_CRYPTO}/ocsp/ocsp_prn.c"
    "${PATH_TO_CRYPTO}/ocsp/ocsp_srv.c"
    "${PATH_TO_CRYPTO}/ocsp/ocsp_vfy.c"
    "${PATH_TO_CRYPTO}/ocsp/v3_ocsp.c"
    "${PATH_TO_CRYPTO}/pem/pem_all.c"
    "${PATH_TO_CRYPTO}/pem/pem_err.c"
    "${PATH_TO_CRYPTO}/pem/pem_info.c"
    "${PATH_TO_CRYPTO}/pem/pem_lib.c"
    "${PATH_TO_CRYPTO}/pem/pem_oth.c"
    "${PATH_TO_CRYPTO}/pem/pem_pk8.c"
    "${PATH_TO_CRYPTO}/pem/pem_pkey.c"
    "${PATH_TO_CRYPTO}/pem/pem_sign.c"
    "${PATH_TO_CRYPTO}/pem/pem_x509.c"
    "${PATH_TO_CRYPTO}/pem/pem_xaux.c"
    "${PATH_TO_CRYPTO}/pem/pvkfmt.c"
    "${PATH_TO_CRYPTO}/pkcs12/p12_add.c"
    "${PATH_TO_CRYPTO}/pkcs12/p12_asn.c"
    "${PATH_TO_CRYPTO}/pkcs12/p12_attr.c"
    "${PATH_TO_CRYPTO}/pkcs12/p12_crpt.c"
    "${PATH_TO_CRYPTO}/pkcs12/p12_crt.c"
    "${PATH_TO_CRYPTO}/pkcs12/p12_decr.c"
    "${PATH_TO_CRYPTO}/pkcs12/p12_init.c"
    "${PATH_TO_CRYPTO}/pkcs12/p12_key.c"
    "${PATH_TO_CRYPTO}/pkcs12/p12_kiss.c"
    "${PATH_TO_CRYPTO}/pkcs12/p12_mutl.c"
    "${PATH_TO_CRYPTO}/pkcs12/p12_npas.c"
    "${PATH_TO_CRYPTO}/pkcs12/p12_p8d.c"
    "${PATH_TO_CRYPTO}/pkcs12/p12_p8e.c"
    "${PATH_TO_CRYPTO}/pkcs12/p12_sbag.c"
    "${PATH_TO_CRYPTO}/pkcs12/p12_utl.c"
    "${PATH_TO_CRYPTO}/pkcs12/pk12err.c"
    "${PATH_TO_CRYPTO}/pkcs7/bio_pk7.c"
    "${PATH_TO_CRYPTO}/pkcs7/pk7_asn1.c"
    "${PATH_TO_CRYPTO}/pkcs7/pk7_attr.c"
    "${PATH_TO_CRYPTO}/pkcs7/pk7_doit.c"
    "${PATH_TO_CRYPTO}/pkcs7/pk7_lib.c"
    "${PATH_TO_CRYPTO}/pkcs7/pk7_mime.c"
    "${PATH_TO_CRYPTO}/pkcs7/pk7_smime.c"
    "${PATH_TO_CRYPTO}/pkcs7/pkcs7err.c"
    "${PATH_TO_CRYPTO}/poly1305/poly1305.c"
    "${PATH_TO_CRYPTO}/poly1305/poly1305_ameth.c"
    "${PATH_TO_CRYPTO}/poly1305/poly1305_pmeth.c"
    "${PATH_TO_CRYPTO}/rand/drbg_ctr.c"
    "${PATH_TO_CRYPTO}/rand/drbg_lib.c"
    "${PATH_TO_CRYPTO}/rand/rand_egd.c"
    "${PATH_TO_CRYPTO}/rand/rand_err.c"
    "${PATH_TO_CRYPTO}/rand/rand_lib.c"
    "${PATH_TO_CRYPTO}/rand/rand_unix.c"
    "${PATH_TO_CRYPTO}/rand/rand_vms.c"
    "${PATH_TO_CRYPTO}/rand/rand_win.c"
    "${PATH_TO_CRYPTO}/rand/randfile.c"
    "${PATH_TO_CRYPTO}/rc2/rc2_cbc.c"
    "${PATH_TO_CRYPTO}/rc2/rc2_ecb.c"
    "${PATH_TO_CRYPTO}/rc2/rc2_skey.c"
    "${PATH_TO_CRYPTO}/rc2/rc2cfb64.c"
    "${PATH_TO_CRYPTO}/rc2/rc2ofb64.c"
    "${PATH_TO_CRYPTO}/rc4/rc4_enc.c"
    "${PATH_TO_CRYPTO}/rc4/rc4_skey.c"
    "${PATH_TO_CRYPTO}/ripemd/rmd_dgst.c"
    "${PATH_TO_CRYPTO}/ripemd/rmd_one.c"
    "${PATH_TO_CRYPTO}/rsa/rsa_ameth.c"
    "${PATH_TO_CRYPTO}/rsa/rsa_asn1.c"
    "${PATH_TO_CRYPTO}/rsa/rsa_chk.c"
    "${PATH_TO_CRYPTO}/rsa/rsa_crpt.c"
    "${PATH_TO_CRYPTO}/rsa/rsa_depr.c"
    "${PATH_TO_CRYPTO}/rsa/rsa_err.c"
    "${PATH_TO_CRYPTO}/rsa/rsa_gen.c"
    "${PATH_TO_CRYPTO}/rsa/rsa_lib.c"
    "${PATH_TO_CRYPTO}/rsa/rsa_meth.c"
    "${PATH_TO_CRYPTO}/rsa/rsa_mp.c"
    "${PATH_TO_CRYPTO}/rsa/rsa_none.c"
    "${PATH_TO_CRYPTO}/rsa/rsa_oaep.c"
    "${PATH_TO_CRYPTO}/rsa/rsa_ossl.c"
    "${PATH_TO_CRYPTO}/rsa/rsa_pk1.c"
    "${PATH_TO_CRYPTO}/rsa/rsa_pmeth.c"
    "${PATH_TO_CRYPTO}/rsa/rsa_prn.c"
    "${PATH_TO_CRYPTO}/rsa/rsa_pss.c"
    "${PATH_TO_CRYPTO}/rsa/rsa_saos.c"
    "${PATH_TO_CRYPTO}/rsa/rsa_sign.c"
    "${PATH_TO_CRYPTO}/rsa/rsa_ssl.c"
    "${PATH_TO_CRYPTO}/rsa/rsa_x931.c"
    "${PATH_TO_CRYPTO}/rsa/rsa_x931g.c"
    "${PATH_TO_CRYPTO}/seed/seed.c"
    "${PATH_TO_CRYPTO}/seed/seed_cbc.c"
    "${PATH_TO_CRYPTO}/seed/seed_cfb.c"
    "${PATH_TO_CRYPTO}/seed/seed_ecb.c"
    "${PATH_TO_CRYPTO}/seed/seed_ofb.c"
    "${PATH_TO_CRYPTO}/sha/keccak1600.c"
    "${PATH_TO_CRYPTO}/sha/sha1_one.c"
    "${PATH_TO_CRYPTO}/sha/sha1dgst.c"
    "${PATH_TO_CRYPTO}/sha/sha256.c"
    "${PATH_TO_CRYPTO}/sha/sha512.c"
    "${PATH_TO_CRYPTO}/siphash/siphash.c"
    "${PATH_TO_CRYPTO}/siphash/siphash_ameth.c"
    "${PATH_TO_CRYPTO}/siphash/siphash_pmeth.c"
    "${PATH_TO_CRYPTO}/sm2/sm2_crypt.c"
    "${PATH_TO_CRYPTO}/sm2/sm2_err.c"
    "${PATH_TO_CRYPTO}/sm2/sm2_pmeth.c"
    "${PATH_TO_CRYPTO}/sm2/sm2_sign.c"
    "${PATH_TO_CRYPTO}/sm3/m_sm3.c"
    "${PATH_TO_CRYPTO}/sm3/sm3.c"
    "${PATH_TO_CRYPTO}/sm4/sm4.c"
    "${PATH_TO_CRYPTO}/srp/srp_lib.c"
    "${PATH_TO_CRYPTO}/srp/srp_vfy.c"
    "${PATH_TO_CRYPTO}/stack/stack.c"
    "${PATH_TO_CRYPTO}/store/loader_file.c"
    "${PATH_TO_CRYPTO}/store/store_err.c"
    "${PATH_TO_CRYPTO}/store/store_init.c"
    "${PATH_TO_CRYPTO}/store/store_lib.c"
    "${PATH_TO_CRYPTO}/store/store_register.c"
    "${PATH_TO_CRYPTO}/store/store_strings.c"
    "${PATH_TO_CRYPTO}/threads_none.c"
    "${PATH_TO_CRYPTO}/threads_pthread.c"
    "${PATH_TO_CRYPTO}/threads_win.c"
    "${PATH_TO_CRYPTO}/ts/ts_asn1.c"
    "${PATH_TO_CRYPTO}/ts/ts_conf.c"
    "${PATH_TO_CRYPTO}/ts/ts_err.c"
    "${PATH_TO_CRYPTO}/ts/ts_lib.c"
    "${PATH_TO_CRYPTO}/ts/ts_req_print.c"
    "${PATH_TO_CRYPTO}/ts/ts_req_utils.c"
    "${PATH_TO_CRYPTO}/ts/ts_rsp_print.c"
    "${PATH_TO_CRYPTO}/ts/ts_rsp_sign.c"
    "${PATH_TO_CRYPTO}/ts/ts_rsp_utils.c"
    "${PATH_TO_CRYPTO}/ts/ts_rsp_verify.c"
    "${PATH_TO_CRYPTO}/ts/ts_verify_ctx.c"
    "${PATH_TO_CRYPTO}/txt_db/txt_db.c"
    "${PATH_TO_CRYPTO}/ui/ui_err.c"
    "${PATH_TO_CRYPTO}/ui/ui_lib.c"
    "${PATH_TO_CRYPTO}/ui/ui_null.c"
    "${PATH_TO_CRYPTO}/ui/ui_openssl.c"
    "${PATH_TO_CRYPTO}/ui/ui_util.c"
    "${PATH_TO_CRYPTO}/uid.c"
    "${PATH_TO_CRYPTO}/whrlpool/wp_block.c"
    "${PATH_TO_CRYPTO}/whrlpool/wp_dgst.c"
    "${PATH_TO_CRYPTO}/x509/by_dir.c"
    "${PATH_TO_CRYPTO}/x509/by_file.c"
    "${PATH_TO_CRYPTO}/x509/t_crl.c"
    "${PATH_TO_CRYPTO}/x509/t_req.c"
    "${PATH_TO_CRYPTO}/x509/t_x509.c"
    "${PATH_TO_CRYPTO}/x509/x509_att.c"
    "${PATH_TO_CRYPTO}/x509/x509_cmp.c"
    "${PATH_TO_CRYPTO}/x509/x509_d2.c"
    "${PATH_TO_CRYPTO}/x509/x509_def.c"
    "${PATH_TO_CRYPTO}/x509/x509_err.c"
    "${PATH_TO_CRYPTO}/x509/x509_ext.c"
    "${PATH_TO_CRYPTO}/x509/x509_lu.c"
    "${PATH_TO_CRYPTO}/x509/x509_meth.c"
    "${PATH_TO_CRYPTO}/x509/x509_obj.c"
    "${PATH_TO_CRYPTO}/x509/x509_r2x.c"
    "${PATH_TO_CRYPTO}/x509/x509_req.c"
    "${PATH_TO_CRYPTO}/x509/x509_set.c"
    "${PATH_TO_CRYPTO}/x509/x509_trs.c"
    "${PATH_TO_CRYPTO}/x509/x509_txt.c"
    "${PATH_TO_CRYPTO}/x509/x509_v3.c"
    "${PATH_TO_CRYPTO}/x509/x509_vfy.c"
    "${PATH_TO_CRYPTO}/x509/x509_vpm.c"
    "${PATH_TO_CRYPTO}/x509/x509cset.c"
    "${PATH_TO_CRYPTO}/x509/x509name.c"
    "${PATH_TO_CRYPTO}/x509/x509rset.c"
    "${PATH_TO_CRYPTO}/x509/x509spki.c"
    "${PATH_TO_CRYPTO}/x509/x509type.c"
    "${PATH_TO_CRYPTO}/x509/x_all.c"
    "${PATH_TO_CRYPTO}/x509/x_attrib.c"
    "${PATH_TO_CRYPTO}/x509/x_crl.c"
    "${PATH_TO_CRYPTO}/x509/x_exten.c"
    "${PATH_TO_CRYPTO}/x509/x_name.c"
    "${PATH_TO_CRYPTO}/x509/x_pubkey.c"
    "${PATH_TO_CRYPTO}/x509/x_req.c"
    "${PATH_TO_CRYPTO}/x509/x_x509.c"
    "${PATH_TO_CRYPTO}/x509/x_x509a.c"
    "${PATH_TO_CRYPTO}/x509v3/pcy_cache.c"
    "${PATH_TO_CRYPTO}/x509v3/pcy_data.c"
    "${PATH_TO_CRYPTO}/x509v3/pcy_lib.c"
    "${PATH_TO_CRYPTO}/x509v3/pcy_map.c"
    "${PATH_TO_CRYPTO}/x509v3/pcy_node.c"
    "${PATH_TO_CRYPTO}/x509v3/pcy_tree.c"
    "${PATH_TO_CRYPTO}/x509v3/v3_addr.c"
    "${PATH_TO_CRYPTO}/x509v3/v3_admis.c"
    "${PATH_TO_CRYPTO}/x509v3/v3_akey.c"
    "${PATH_TO_CRYPTO}/x509v3/v3_akeya.c"
    "${PATH_TO_CRYPTO}/x509v3/v3_alt.c"
    "${PATH_TO_CRYPTO}/x509v3/v3_asid.c"
    "${PATH_TO_CRYPTO}/x509v3/v3_bcons.c"
    "${PATH_TO_CRYPTO}/x509v3/v3_bitst.c"
    "${PATH_TO_CRYPTO}/x509v3/v3_conf.c"
    "${PATH_TO_CRYPTO}/x509v3/v3_cpols.c"
    "${PATH_TO_CRYPTO}/x509v3/v3_crld.c"
    "${PATH_TO_CRYPTO}/x509v3/v3_enum.c"
    "${PATH_TO_CRYPTO}/x509v3/v3_extku.c"
    "${PATH_TO_CRYPTO}/x509v3/v3_genn.c"
    "${PATH_TO_CRYPTO}/x509v3/v3_ia5.c"
    "${PATH_TO_CRYPTO}/x509v3/v3_info.c"
    "${PATH_TO_CRYPTO}/x509v3/v3_int.c"
    "${PATH_TO_CRYPTO}/x509v3/v3_lib.c"
    "${PATH_TO_CRYPTO}/x509v3/v3_ncons.c"
    "${PATH_TO_CRYPTO}/x509v3/v3_pci.c"
    "${PATH_TO_CRYPTO}/x509v3/v3_pcia.c"
    "${PATH_TO_CRYPTO}/x509v3/v3_pcons.c"
    "${PATH_TO_CRYPTO}/x509v3/v3_pku.c"
    "${PATH_TO_CRYPTO}/x509v3/v3_pmaps.c"
    "${PATH_TO_CRYPTO}/x509v3/v3_prn.c"
    "${PATH_TO_CRYPTO}/x509v3/v3_purp.c"
    "${PATH_TO_CRYPTO}/x509v3/v3_skey.c"
    "${PATH_TO_CRYPTO}/x509v3/v3_sxnet.c"
    "${PATH_TO_CRYPTO}/x509v3/v3_tlsf.c"
    "${PATH_TO_CRYPTO}/x509v3/v3_utl.c"
    "${PATH_TO_CRYPTO}/x509v3/v3err.c"
    "${PATH_TO_OPENSSL}/engines/e_capi.c"
    "${PATH_TO_OPENSSL}/engines/e_padlock.c"
)

set(CRYPTO_INCLUDE_DIRS
    "${PATH_TO_EXTERNAL}/generatedHeaders/android"
    "${PATH_TO_EXTERNAL}/generatedHeaders/android/internal"
    "${PATH_TO_OPENSSL}"
    "${PATH_TO_OPENSSL}/include"
    "${PATH_TO_CRYPTO}/include"
    "${PATH_TO_CRYPTO}/modes"
    "${PATH_TO_CRYPTO}/ec/curve448"
    "${PATH_TO_CRYPTO}/ec/curve448/arch_32"
    )

#########################
### Set up static lib ###
#########################

add_library(
    "${PROJECT_NAME}"
    STATIC
    "${CRYPTO_SOURCE_FILES}"
)

target_include_directories(
    "${PROJECT_NAME}"
    PRIVATE
    "${CRYPTO_INCLUDE_DIRS}"
)

include("../GetOpenSSLFlags.cmake")
get_openssl_flags(FLAGS FLAGS_DEBUG FLAGS_RELEASE)

include("../../TargetSetFlags.cmake")
target_set_flags(
    "${PROJECT_NAME}"
    "${FLAGS}"
    "${FLAGS_DEBUG}"
    "${FLAGS_RELEASE}"
)
